<template>
  <div>
      <table align='center'>
          <tr>
              <td align='center'>姓名</td>
              <td align='center'>审核</td>
          </tr>
          <tr  v-for="i in list" :key='i'>
              <td>{{i.name}}  </td>
              <td><van-button type='primary' @click="auilt(i.id)">审核</van-button></td>
          </tr>
      </table>
      
      <div align='center'   >
      <van-dialog v-model:show="show" title="审核中" show-cancel-button>
        <van-field :lable='描述'>描述</van-field>
        <van-radio-group v-model="status" direction="horizontal">
            <van-radio name="2">通过</van-radio>&emsp;&emsp;&emsp;&emsp;&emsp;
            <van-radio name="3">未通过</van-radio>
        </van-radio-group>
        <van-button type='success' @click="submit">提交</van-button>
      </van-dialog>
      </div>
  </div>
</template>

<script>
import myaxios from 'axios'
import axios from 'axios'
export default {
    data(){
        return{
            list:[],
            dispyer:'',
            show:false,
            status:2,
            id:0,
            // show-cancel-button=true
        }
    },
    methods:{
        getlist(){
            myaxios({url:'http://127.0.0.1:8000/getlist/',method:'get'})
            .then(res=>{
                this.list=res.data.list
            })
        },
        auilt(id){
            this.id=id
            this.show=true
        },
        submit(){
            axios({url:'http://127.0.0.1:8000/getlist/',method:'post',data:{'id':this.id,'status':this.status}}).then(res=>{
                console.log(res)
                this.$toast.fail("ok");
                
            })
        }
    },
    mounted() {
        this.getlist()
  }
}
</script>

<style>

</style>